require('./mobileHTML.css');

const DOM = require('./mobileHTML.html');

let mobile = document.createElement('div');
mobile.id = '#mobile';
mobile.innerHTML = DOM;

let body = document.getElementsByTagName('body')[0];

if (body.children[0]) {
  body.insertBefore(mobile, body.children[0]);
} else {
  body.appendChild(mobile);
}

//判断浏览器是否在线
if (window.navigator.onLine) {
  console.log('on line');
} else {
  console.log('off line');
}

//html5 中的 dataset
let mydata = document.getElementById('dataset');
if (mydata.dataset) {
  console.log(mydata.dataset);
} else {
  console.log('dataset none');
}
